//
//  ProdDetailItemView.m
//  JiaoX
//
//  Created by yinqy on 15/4/13.
//  Copyright (c) 2015年 北京娇羞科技有限公司. All rights reserved.
//

#import "ProdDetailItemView.h"

@implementation ProdDetailItemView


-(void)setItemInfo:(SelfItemInfo *)itemInfo{
    UIView *splite = [[UIView alloc]initWithFrame:CGRectMake(10, self.height-0.5, self.width-10, 0.5)];
    [splite setBackgroundColor:SEPARATORCOLOR];
    [self addSubview:splite];
    
    _itemInfo = itemInfo;
    [self.itemImg setImage:IMG(itemInfo.icon)];
    [self.itemTitle setText:itemInfo.title];
    
    NSString *subTitle = [NSString stringWithFormat:@"%@",itemInfo.subtitle];
    if (!itemInfo.subtitle) {
        [self.itemSubtitle setHidden:YES];
    }else{
        [self.itemSubtitle setHidden:NO];
        [self.itemSubtitle setText:subTitle];
    }//娇羞的程序员
    
}
- (IBAction)tap:(id)sender {
    if (_itemInfo.operation) {
        _itemInfo.operation();
    }
}

@end
